
import React from 'react'
import ReactDOM from 'react-dom'

import * as UnitAction  from '../../actions/UnitAction';
import { connect }  from 'react-redux';

class PushMessageSettingEdit extends React.Component {
  constructor(props) {
    super(props)

    this.state = {

    }
  }

  componentWillReceiveProps() {
    // console.log("componentWillReceiveProps")
  }

  componentDidMount() {

  }

  componentDidUpdate () {

  }


  onChange(event, key) {
    var value = $(event.target).val();
    var data = this.state.data;
    data[key] = value;
    this.setState({
      data: data
    })
  }


  pad(n) {
    return n < 10 ? "0"+n : n;
  }


  render() {
    var self = this;
    return (
      <div className="modal fade" id="PushMessageSettingEdit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div className="modal-dialog" role="document">
          <div className="modal-content">
            <div className="modal-header">
              <button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <h4 className="modal-title" id="Delivery-modal-label">选择消息</h4>
            </div>
            <div className="modal-body">
              <button type="button" className="btn btn-info  btn-block"
                      onClick={(event)=>this.props.onMessageTypeClick('delivery')}>快递消息</button>
            </div>
            <div className="modal-footer">
              <button type="button" className="btn btn-default" data-dismiss="modal">取消</button>
            </div>
          </div>
        </div>
      </div>
    )
  }
}

const mapStateToProps = (state, ownProps) => {
  return {
    data: state.units
  }
}

export default connect(mapStateToProps)(PushMessageSettingEdit)
